package com.xue.handler;

import com.xue.domain.StaticLocationResponseInfo;
import com.xue.geo.AreaControl;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import lombok.extern.slf4j.Slf4j;

/**
 * @author xue
 * @create 2022-09-21 11:15
 */
@Slf4j
@ChannelHandler.Sharable
public class StaticLocationResponseInfoHandler extends SimpleChannelInboundHandler<StaticLocationResponseInfo> {

    private AreaControl areaControl = AreaControl.getInstance();

    @Override
    protected void channelRead0(ChannelHandlerContext ctx, StaticLocationResponseInfo msg) throws Exception {
        log.info("收到静态点信息如下：\n{}", msg);
        areaControl.receivedStaticPoint(msg.getList());
    }

}
